The present invention relates to digital image color correction and in particular to a localized background color correction based on varying image background luminance.
Images that are captured by an image detection device such as a digital camera are often different than the actual image perceived by the device user. The discrepancy between the perceived and detected image are due to many factors such as the characteristics and settings of the image detection device, ambient lighting conditions, and the difference between the human visual perception model and the image detection device perception model, to name a few. One problem that is seen when detecting images is due to the uneven illumination of the image. In this case, when the image detection device detects an unevenly illuminated image, the resulting detected image will often have portions that are too light/dark such that image quality is greatly reduced.
One prior art solution for evening out image illumination is by manual adjustment of image parameters. For instance, the techniques known as dodging and burning require a user to physically specify or identify regions of the image to be lightened or darkened. Dodging and burning consists of cutting and positioning physical masks during the photographic development process. These techniques can also be carried out digitally using a mouse or other computer interface to select specific pixels or regions in an image to be lightened or darkened. In addition to manually identifying regions for adjustment, the user must also control the amount of adjustment. The problem with this technique is that it requires a certain level of skill and a large amount of time and effort to achieve. Another solution is based on Retinex or edge-ratio preserving algorithms. These algorithms use an iterative processing of an image in order to determine a corrected output image. This iterative process consists of taking ratios of a number of neighboring pixel values, multiplying these ratios and finally, resetting these ratios if some maximum value is achieved. In this way image edge lightness values are better reproduced and, given a large enough number of ratios, these lightness values should be normalized relative to the image white. The assumption is that this sequence of calculations mimics the human visual system. Specifically, an observer is constantly scanning an image or scene and is performing some type of normalization relative to the scene or image white. The algorithms attempt to model the human visual system and reconstruct a digitally captured image with perceptually correct local color correction from a given scene. Given a calibrated input, this approach generates images that are similar to those that might be produced using the manual technique, where a calibrated input is an image that accurately represents some physical quantity that can be directly measured, such as radiance or luminance. However, current implementations tend to be computationally intensive. In addition, there is no simple framework to allow an interactive or user specified control over these algorithms that is important for either correcting uncalibrated inputs images or for correcting under, over and unevenly exposed images. Other approaches include histogram equalization, image segmentation, or specialized hardware. Histogram equalization techniques use properties of the statistical distribution of the lightness values in the image to derive a tone correction curve for that image. Image segmentation techniques attempt to automatically partition images into regions. These regions are then lightened or darkened based on an analysis of these regions. Hardware such as logarithmic CCD sensors and dual sampling CMOS sensors provide a better means of capturing high dynamic range scene data. However, this hardware does not specify how this high dynamic range data should be processed or mapped to a lower dynamic range devices.
In order to xe2x80x9ccorrectxe2x80x9d images when they are captured by the detection device the images are initially converted into a digital data format to allow for image enhancement and processing. The digital data format is represented by an array of picture elements (i.e., pixels) where each pixel has associated digital information describing the image at that pixel location within the array. The digital data of the image can be represented in different types of color space representations. One type of color space representation, referred to as a perceptual color space (or color space model) representation, defines pixels by perceptual parameters of the image. The color space model is defined as a viewing specific transformation of the XYZ representation to/from a perceptual attributes representation. For instance, in the case of CIELAB each color component is defined by three attributes lightness (L*), chroma and hue. The coordinates a* and b* are the Cartesian coordinates that can be computed from lightness, chroma and hue using standard polar to Cartesian coordinate transformations. The a* and b* axes correspond to the red-green and yellow-blue opponent color axes. Another state of the art perceptual color space or color appearance model that has been recently developed referred to as CIECAM97s defines color components by three attributes including lightness (J), chroma (C) and hue (H).
FIG. 1 shows a flow chart of the steps performed when converting image pixel data (i.e., Sample XYZ and White Point XYZ) into the CIECAM97s color space representation. As can be seen, one of the parameters that the lightness, chroma and hue attributes are a function of is the background luminance, Yb, where the background is defined as the region of a scene or image that subtends roughly 12 to 14 degrees, centered on an image stimulus or target. Typically, the Yb parameter has been set to 20 during image conversion and has implicitly incorporated a gray world assumption. Both of the lightness and chroma of an image are a function of background luminance.
What would be desirable would be to use the background luminance parameter of a perceptual color space to adjust uneven illumination of a digital image.
A color correction apparatus and method in which a mask is derived from image data in a first pixel representation and is used to convert the image data into a second color space representation which is a function of a background luminance parameter. The mask comprises a set of digital values having a pixel-by-pixel correspondence with the original image. The values within the mask vary dependent on the location of the corresponding pixel within the image data. When converting the image data pixel-by-pixel into the second color space representation, localized background color correction is obtained by using the varying mask values as the background luminance parameter for each pixel conversion.
In accordance with one embodiment of the apparatus and method of color correction, a mask is derived by decimating the image data to generate a condensed version of the pixel data, filtering the condensed version of the pixel data by averaging each pixel value of the condensed version with surrounding pixel values and replacing each pixel value with the averaged value of the surrounding pixel values; expanding the filtered condensed version such that there is one-to-one correspondence between pixel values in the expanded version and pixel values in the original image; scaling pixel values in the expanded version into a greyscale representation to obtain the mask.
In accordance with an alternative embodiment of the apparatus and method of color correction, the mask is derived by processing each pixel value in the original image to derive a corresponding mask value 1) by determining the average of pixel values surrounding each pixel value and replacing each pixel value with the average 2) scaling the averaged values into a greyscale to obtain the corresponding mask value.
In accordance with another embodiment of the apparatus and method of color correction the averaged values are weighted according to a Gaussian function.
In an alternative embodiment of the apparatus and method of color correction the color corrected second color space representation of the image is inversely converted back into the first color space representation using a fixed background luminance parameter.
In still another embodiment, the color corrected first color space representation is reiteratively color corrected by deriving a new mask and re-converting back into the second color space representation using the new mask.